package routes

import (
	"github.com/goravel/framework/contracts/route"
	"github.com/goravel/framework/facades"

	"goravel/app/http/controllers"
)

func Api() {
	facades.Route().Prefix("api").Group(func(router route.Router) {
		spiderCtrl := controllers.NewSpiderController()
		router.Post("combine", spiderCtrl.Combination)
		router.Post("cookie", spiderCtrl.Cookie)

		searchFilterCtrl := controllers.NewSearchfilterController()
		router.Resource("searchfilter", searchFilterCtrl)

		commentFilterCtrl := controllers.NewCommentfilterController()
		router.Resource("commentfilter", commentFilterCtrl)

		//组合列表
		searchCommentCtrl := controllers.NewSearchCommentController()
		router.Get("searchcomment", searchCommentCtrl.Index)
		router.Get("searchcomment/list", searchCommentCtrl.List)
		//组合
		router.Post("searchcomment/combine", searchCommentCtrl.Combine)
		//拆分
		router.Post("searchcomment/separate", searchCommentCtrl.Separate)

		//评论模板
		messageCtrl := controllers.NewMessageController()
		router.Post("message", messageCtrl.Store)
		router.Get("message", messageCtrl.Index)
	})
}
